#!/usr/bin/env node

// 引入readline模块
const readline = require('readline')

// 创建readline接口实例
const rl = readline.createInterface({
    input:process.stdin,
    output:process.stdout
})
let movies = new Map()
rl.on('line',line=>{
    const [movie, num ] = line.split('\t')
    if(!movies.has(movie)){
        movies.set(movie,parseInt(num))
    }else{
        movies.set(movie,movies.get(movie) + 1)
    }
})
rl.on("close", () => {
    movies.forEach((v, k) => {
        // 将统计结果写入标准输出
        console.log(`${k}\t${v}`)
    })
    process.exit(0)
})
